vmx: Fix the 2nd argument of cpuid_count() in vmx_cpuid_intercept()
authorKeir Fraser <keir.fraser@citrix.com>
Sat, 29 Dec 2007 17:55:47 +0000 (17:55 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Sat, 29 Dec 2007 17:55:47 +0000 (17:55 +0000)
For input 0x00000004, the value of "*ecx" has been overwritten by the
cpuid() in hvm_cpuid(), causing a bad value passed to cpuid_count().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
xen/arch/x86/hvm/vmx/vmx.c

index 1e700d8d2e00eb520f3870088b129852f1786f29..b414078ab23473eb36d2671e873114d09a5def0d 100644 (file)
@@ -1235,6 +1235,7 @@ void vmx_cpuid_intercept(
     unsigned int *ecx, unsigned int *edx)
 {
     unsigned int input = *eax;
+    unsigned int count = *ecx;
 
 #ifdef VMXASSIST
     if ( input == 0x40000003 )
@@ -1293,7 +1294,7 @@ void vmx_cpuid_intercept(
         break;
 
     case 0x00000004:
-        cpuid_count(input, *ecx, eax, ebx, ecx, edx);
+        cpuid_count(input, count, eax, ebx, ecx, edx);
         *eax &= NUM_CORES_RESET_MASK;
         break;